home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tool-inc.zip / STOLOWER.INC < prev    next >
Text File  |  1989-06-02  |  1KB  |  47 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*--------------------------------------------------------
  14.  *   map string to lower case (tpas 4.0)  3-1-89
  15.  *
  16.  *)
  17.  
  18. {$F+} procedure stolower(var st: string); {$F-}
  19. begin
  20.  
  21.    Inline(
  22.      $C4/$7E/$06/           {   les di,[bp]6         ;es:di -> st[0]}
  23.      $26/                   {   es:}
  24.      $8A/$0D/               {   mov cl,[di]          ;cl = length}
  25.      $FE/$C1/               {   inc cl}
  26.  
  27.                             {next:}
  28.      $47/                   {   inc di}
  29.      $FE/$C9/               {   dec cl}
  30.      $74/$12/               {   jz ends}
  31.  
  32.      $26/                   {   es:}
  33.      $8A/$05/               {   mov al,[di]}
  34.      $3C/$41/               {   cmp al,'A'}
  35.      $72/$F4/               {   jb next}
  36.      $3C/$5A/               {   cmp al,'Z'}
  37.      $77/$F0/               {   ja next}
  38.  
  39.      $04/$20/               {   add al,' '}
  40.      $26/                   {   es:}
  41.      $88/$05/               {   mov [di],al}
  42.      $EB/$E9);              {   jmp next}
  43.  
  44.                             {ends:}
  45. end;
  46.  
  47.